package com.syj.usepagehelper.model.vo.response;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.Valid;
import java.io.Serializable;

/**
 * BaseResponse：
 *
 * @author: 石蕴杰
 * @date: 2020/4/9 15:33
 */
@Data
public class BaseResponse<T> implements Serializable {
    private static final long serialVersionUID = 8281822272466952313L;
    /**
     * 返回码
     */
    @ApiModelProperty(value = "返回码")
    private String code;
    /**
     * 返回信息
     */
    @ApiModelProperty(value = "返回信息")
    private String message;
    /**
     * 返回数据
     */
    @ApiModelProperty(value = "数据结果")
    @Valid
    private T result;

    public BaseResponse() {
    }

    public BaseResponse(String code) {
        this.code = code;
    }

    public BaseResponse(String code, T result) {
        this.code = code;
        this.result = result;
    }

    public BaseResponse(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public BaseResponse(String code, String message, T result) {
        this.code = code;
        this.message = message;
        this.result = result;
    }
}
